<template>
  <text class="" :style="{fontWeight: fontWeight, fontSize: `${fontSize * 1.4}rpx`}">
    <text>￥</text><text class="mx-1" :style="{fontSize: `${fontSize * 2}rpx`}">{{ nums[0] }}</text><text v-if="nums[1]">.{{ nums[1] }}</text><text v-if="suffix" class="">{{ typeof suffix === 'string' ? suffix : '元' }}</text>
  </text>
</template>

<script setup>
import { computed, defineProps } from 'vue'
const props = defineProps({
  value: {
    type: [String, Number],
    default: 0
  },
  fontSize: {
    type: [String, Number],
    default: 18
  },
  fontWeight: {
    type: [String, Number],
    default: 'bold'
  },
  suffix: [Boolean, String]
})
const nums = computed(() => props.value.toString().split('.'))
</script>

<style>

</style>
